import { useSelector } from "react-redux"
import type { ROOTSTATE } from "../Store"
import { Login } from "./Header/login"

type Props = {
    children: React.ReactNode
}
export const RouterAuth = ({children}:Props)=>{
    const {isLogin} = useSelector((state:ROOTSTATE)=> state.userStore)
    return isLogin ? children : <Login></Login>
}